package com.lwh.springboot.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//这是一个配置文件，可以配置拦截器
@Configuration
public class WebConfigurer implements WebMvcConfigurer {

    //虚拟路径
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/img/**")
                .addResourceLocations("file:/D:/image/");
        WebMvcConfigurer.super.addResourceHandlers(registry);
    }

}
